package me.sdevil507.biz.common.sysdict.po;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import me.sdevil507.supports.jpa.BaseJpaSnowflakeIdEntity;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @program: tips_back_end
 * @description: 数据字典表
 * @author: kzl
 * @create: 2020-06-24 11:47
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "biz_sysdict")
@Where(clause="is_del = 0")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SysDict extends BaseJpaSnowflakeIdEntity implements Serializable {

    /**
     * 类别key
     */
    @Column(name="type_key")
    private String typeKey;

    /**
     * 数据字段名称
     */
    @Column(name="d_name")
    private String dname;

    /**
     * 数据字典编码
     */
    @Column(name="d_code")
    private String dcode;

    /**
     * 数据字典值
     */
    @Column(name="d_value")
    private String dvalue;

    /**
     * 数据字典备注
     */
    @Column(name="d_comment")
    private String dcomment;

    /**
     * 父级id
     */
    @Column
    private Long parentId;

    /**
     * 是否删除
     */
    @Column
    private Boolean  isDel= false;

    /**
     * 排序
     */
    @Column
    private String  ranking;

    /**
     * 级别
     */
    @Column
    private String  level;

    /**
     * 是否展开
     */
    @Transient
    private boolean expand = true;

    /**
     * 创建时间
     */
    @Column
    private Date createTime = new Date();

    /**
     * 更新时间
     */
    @Column
    private Date updateTime = new Date();

    @Transient
    private List<SysDict> children;
}
